#include <iostream>
#include <unistd.h>
#include <sys/types.h>

int num = 10;

int main()
{
  pid_t id = vfork();
  if(id < 0){
    perror("vfork");
    return 1;
  }

  if(id == 0){
    num = 200;
    printf("I am child! num: %d &num: %p\n", num, &num);
    exit(0);
  }

  printf("I am father! num: %d &num: %p\n", num, &num);
  sleep(1);
  return 0;
}
